home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Clock / Sources / Content.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  5.2 KB  |  170 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Content.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef CONTENT_H
  11. #define CONTENT_H
  12.  
  13. // ----- FrameWork Includes -----
  14.  
  15. #ifndef FWCONTNT_H
  16. #include "FWContnt.h"
  17. #endif
  18.  
  19. #ifndef FWTIME_H
  20. #include "FWTime.h"
  21. #endif
  22.  
  23. #ifndef FWSTRING_H
  24. #include "FWString.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. //    class CClockContent
  29. //========================================================================================
  30.  
  31. class CClockContent : public FW_CContent
  32. {
  33. //----------------------------------------------------------------------------------------
  34. //    Initialization/Destruction
  35. //
  36.   public:
  37.     FW_DECLARE_AUTO(CClockContent)
  38.     
  39.     CClockContent(Environment* ev, FW_CPart* part);
  40.  
  41.     virtual ~CClockContent();
  42.  
  43. //----------------------------------------------------------------------------------------
  44. //    Inherited API
  45. //
  46.   public:
  47.     virtual void        ExternalizeKind(Environment* ev,
  48.                                     ODStorageUnit* storageUnit,
  49.                                     FW_CKind* kind,
  50.                                     FW_StorageKinds storageKind,
  51.                                     FW_CPromise* promise,
  52.                                     FW_CCloneInfo* cloneInfo);
  53.     virtual FW_Boolean    InternalizeKind(Environment* ev,
  54.                                     ODStorageUnit* storageUnit, 
  55.                                     FW_CKind* kind,
  56.                                     FW_StorageKinds storageKind,
  57.                                     FW_CCloneInfo* cloneInfo);
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    New API
  61. //
  62.     FW_Boolean            HasTickSound() const;
  63.     FW_Boolean            HasChimeSound() const;
  64.  
  65.     void                ToggleTickSound();
  66.     void                ToggleChimeSound();
  67.  
  68.     FW_CTimeSpan        GetTimeOffset() const;
  69.     void                SetTimeOffset(const FW_CTimeSpan& offset);
  70.  
  71.     FW_CString            GetFaceString() const;
  72.     void                SetFaceString(const FW_CString& faceString);
  73.  
  74.     FW_Boolean            UsesContainerColor() const;
  75.     void                ToggleUsesContainerColor();
  76.     
  77. //----------------------------------------------------------------------------------------
  78. //    Data Members
  79. //
  80.   private:
  81.     //--- part content data
  82.     
  83.     FW_Boolean            fUseContainerColor;
  84.     FW_Boolean            fHasTickSound;
  85.     FW_Boolean            fHasChimeSound;
  86.     FW_CTimeSpan        fTimeOffset;
  87.     FW_CString32         fFaceString;
  88. };
  89.  
  90. //----------------------------------------------------------------------------------------
  91. // CClockContent::HasTickSound
  92. //----------------------------------------------------------------------------------------
  93. inline FW_Boolean CClockContent::HasTickSound() const
  94. {
  95.     return fHasTickSound;
  96. }
  97.  
  98. //----------------------------------------------------------------------------------------
  99. // CClockContent::HasChimeSound
  100. //----------------------------------------------------------------------------------------
  101. inline FW_Boolean CClockContent::HasChimeSound() const
  102. {
  103.     return fHasChimeSound;
  104. }
  105.  
  106. //----------------------------------------------------------------------------------------
  107. // CClockContent::UsesContainerColor
  108. //----------------------------------------------------------------------------------------
  109. inline FW_Boolean CClockContent::UsesContainerColor() const
  110. {
  111.     return fUseContainerColor;
  112. }
  113.  
  114. //----------------------------------------------------------------------------------------
  115. // CClockContent::ToggleTickSound
  116. //----------------------------------------------------------------------------------------
  117. inline void CClockContent::ToggleTickSound()
  118. {
  119.     fHasTickSound = !fHasTickSound;
  120. }
  121.  
  122. //----------------------------------------------------------------------------------------
  123. // CClockContent::ToggleChimeSound
  124. //----------------------------------------------------------------------------------------
  125. inline void CClockContent::ToggleChimeSound()
  126. {
  127.     fHasChimeSound = !fHasChimeSound;
  128. }
  129.  
  130. // CClockContent::ToggleUsesContainerColor
  131. //----------------------------------------------------------------------------------------
  132. inline void CClockContent::ToggleUsesContainerColor()
  133. {
  134.     fUseContainerColor = !fUseContainerColor;
  135. }
  136.  
  137. //----------------------------------------------------------------------------------------
  138. // CClockContent::GetTimeOffset
  139. //----------------------------------------------------------------------------------------
  140. inline FW_CTimeSpan CClockContent::GetTimeOffset() const
  141. {
  142.     return fTimeOffset;
  143. }
  144.  
  145. //----------------------------------------------------------------------------------------
  146. // CClockContent::SetTimeOffset
  147. //----------------------------------------------------------------------------------------
  148. inline void CClockContent::SetTimeOffset(const FW_CTimeSpan& offset)
  149. {
  150.     fTimeOffset = offset;
  151. }
  152.  
  153. //----------------------------------------------------------------------------------------
  154. // CClockContent::GetFaceString
  155. //----------------------------------------------------------------------------------------
  156. inline FW_CString CClockContent::GetFaceString() const
  157. {
  158.     return fFaceString;
  159. }
  160.  
  161. //----------------------------------------------------------------------------------------
  162. // CClockContent::SetFaceString
  163. //----------------------------------------------------------------------------------------
  164. inline void CClockContent::SetFaceString(const FW_CString& faceString)
  165. {
  166.     fFaceString = faceString;
  167. }
  168.  
  169. #endif
  170.